<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>

<%@ include file="../layout/header.jsp"%>

<!-- 主体部分开始 -->
<div class="container" style="margin-top: 10px;">
	<div class="row">
		<h1>修改密码</h1>
		<form action="${ctx}/user.do?type=modifyPassword" method="post"
			onsubmit="return validate();">
			<div class="form-group">
				<label for="oldPassword">旧密码</label>
				<span style="color: red;">&nbsp;&nbsp;${msg}</span>
				<input type="text" class="form-control" id="oldPassword" name="oldPassword" placeholder="旧密码">
			</div>
			<div class="form-group">
				<label for="newPassword">新密码</label> 
				<input type="text" class="form-control" id="newPassword" name="newPassword" placeholder="新密码">
			</div>
			<div class="form-group">
				<label for="newPassword2">重新输入新密码</label> 
				<input type="text" class="form-control" id="newPassword2" name="newPassword2" placeholder="新密码">
			</div>
			<button type="submit" class="btn btn-default">确定</button>
			<a type="button" href="${ctx}/index.jsp" class="btn btn-success">返回</a>
		</form>
	</div>
</div>
<!-- 主体部分结束 -->

<%@ include file="../layout/footer.jsp"%>

<script type="text/javascript">
	function validate() {
		var oldPassword = $("#oldPassword").val();
		var newPassword = $("#newPassword").val();
		var newPassword2 = $("#newPassword2").val();
		if (oldPassword == null || oldPassword.length == 0) {
			alert("旧密码不能为空！");
			return false;
		}
		if (newPassword == null || newPassword.length == 0) {
			alert("新密码不能为空！");
			return false;
		}
		if (newPassword2 == null || newPassword2.length == 0) {
			alert("确认密码不能为空！");
			return false;
		}
		if (newPassword2 != newPassword) {
			alert("两次密码不一致！");
			return false;
		}
		return true;
	}
</script>




















